package day01;

public class ArthmeticoperatorDemo3 {
    public static void main(String[] args) {
        //++和--
        int a = 10;
        a++;//变量a里面的值+1
        System.out.println(a);
        ++a;//变量a里面的值+1
        System.out.println(a);
        a--;//变量a里面的值-1
        System.out.println(a);
        --a;//变量a里面的值-1
        System.out.println(a);

        int b = 11;
        int c = b++;
        //以上是“先用后加”，先把b的值赋值给c，然后b再+1

        int d = 12;
        int e = ++d;
        //以上是“先加后用”，先把d的值+1，然后再赋值给e
        System.out.println(b);
        System.out.println(c);
        System.out.println(d);
        System.out.println(e);





    }
}
